Repository navigation
impl(atlas): D1 hot-cache schema, binding, and store module (#13100) - #13141
Merged
Merged
Conversation
Follow-on 1 of 6 under #9134 (design §5, §8 item 1): the hot_cache schema as migration 0001, the HOT_CACHE D1 binding in wrangler.toml and cloudflare.config.ts (placeholder id; the real database is created at deploy time), and src/hot_cache.ts with get/put/touch/ evict primitives over the shared table. The tier sits behind HOT_CACHE_ENABLED, default off, so existing read paths are untouched. Env gains the optional binding/flag fields only. Tests: test/hot_cache.test.ts applies the real migration to a local (miniflare) D1 and round-trips entries for all three classes (A/B/C); full package suite 41/41, typecheck clean.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This was referenced Nov 23, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #13100 — follow-on 1 of 6 under the #9134 Atlas D1 tenant hot cache design (§5 storage, §8 item 1).
What lands
migrations/0001_hot_cache.sql— the design §5hot_cacheschema verbatim (shared database, tenant in the key, eviction index on(tenant_id, last_hit_at)).HOT_CACHED1 binding inwrangler.tomland mirrored incloudflare.config.ts, plus theHOT_CACHE_ENABLEDflag (default"false") in both. The committeddatabase_idis the repo's local-placeholder convention (same aspkgs/id/worker-poc/d1-journal-poc): the realatlas-hot-cachedatabase is created at deploy time and its id replaces the placeholder in both files; the README records this.src/hot_cache.ts— the store module:get/put/touch/evictprimitives over the table, plushotCacheEnabled/hotCacheStoregating (flag off or binding absent → no store, callers keep the pre-cache path).src/index.ts—Envgains the optional binding/flag fields only; no read path changes.Acceptance check
migrations/0001_hot_cache.sqlwithmigrations_dirwired in wrangler.toml.test/hot_cache.test.tsapplies the real migration file to the miniflare D1 and round-trips byte-for-byte per class, plus tenant isolation, put-replace bookkeeping reset, touch/hit counting, evict semantics, and flag gating — 10/10.tsc --noEmitclean; nothing outside the new module references the store.Closes #13100.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.